package com.yfp.client.controller;

import com.yfp.client.annotation.AnonymousAccess;
import com.yfp.client.domain.dto.ClientLivenessDTO;
import com.yfp.client.service.MachineClientLivenessService;
import com.yfp.client.util.Response;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 
 * @version 1.0
 * @date 2024-05-28 10:49
 */
@RestController
@RequestMapping("/client/liveness")
@Tag(name = "设备活跃度")
public class MachineClientLivenessController {

    @Autowired
    private MachineClientLivenessService machineClientLivenessService;

    /**
     * 统计活跃度
     * @param clientLivenessDTO
     * @return
     */
    @PostMapping("")
    @ApiOperation(value = "添加活跃度", notes = "添加活跃度")
    @AnonymousAccess
    public Response activesTatistics(@RequestBody ClientLivenessDTO clientLivenessDTO) {
        machineClientLivenessService.activesTatistics(clientLivenessDTO);
        return Response.success();
    }
}
